package com.lanxin.xxform.mappers;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.lanxin.xxform.beans.AnswerItem;
import com.lanxin.xxform.tools.JetCriteria;

@Mapper
public interface AnswerItemMapper {

    @Insert("insert into answer_item (aid,sid,title,content) values (${aid},${sid},#{title},#{content})")
    int insert(AnswerItem item);

    @Select("select ${select} from answer_item ${fullCondition}")
    List<AnswerItem> findAll(JetCriteria criteria);

    @Select("select * from answer_item where aid=${aid}")
    List<AnswerItem> findAllByAnswer(long aid);

    @Delete("delete from answer_item where aid=${aid}")
    int deleteByAnswer(long aid);
    
}
